<script type="text/javascript">
function validasi(){
 var nama = document.formcontact.nama.value;
 if(nama==""){
 alert("enter your name!!!!");
 document.formcontact.nama.focus();
 return false;
} 
 var regex = /^(([\-\w]+)\.?)+@(([\-\w]+)\.?)+\.[a-zA-Z]{2,4}$/;
 if(regex.test(formcontact.email.value)){
 return true;
 }
 else {
 alert("input e-mail address correctly");
 return false;
}
}
</script>

<br />
<form action="http://mr-n.net/cp/validasi.php" method="post" name="formcontact" onsubmit="return validasi()">
<table align="left" border="0" cellspacing="0" style="height: 30px; width: 472px;"><tbody>
<tr>       <td width="123">Full Name</td>       <td width="19"><div>
:</div>
</td>   <td width="324"><label></label><input id="nama" name="nama" type="text" /> </td>     </tr>
<tr>       <td>E-mail</td>      <td><div>
:</div>
</td>  <td><label></label> 
<input id="email" name="email" type="text" /></td>      </tr>
<tr> <td>Subject</td>  
 <td><div>
:</div>
</td>  <td><label></label> 
<input id="phone" name="phone" type="text" /></td>      </tr>
<tr>       <td>Message</td>       <td><div>
:</div>
</td>       <td><label> <textarea cols="40" id="pesan" name="pesan" rows="3"></textarea> </label></td>  </tr>
<tr> <td height="28"><img height="40" src="http://mr-n.net/cp/captcha.php" style="border: 1px solid silver; float: left; margin: -10px 0pt 0pt;" width="76" /></td> <td><div>
:</div>
</td> <td><label>         <input id="kodecaptcha" maxlength="4" name="kodecaptcha" size="4" type="text" />          
Enter Captcha </label>   </td>
</tr>
<tr>      <td><br /></td>      <td><br /></td>      <td><label></label>&nbsp;     <br />
<input name="Submit" type="submit" value="SEND MESSAGE" />      <br />
</td>       </tr>
</tbody>   </table>
</form>